package com.keyingbo.leran.pattern.singletonpattern.innerclass;

/**
 * @Auther: KEYB
 * @Date: 2019-3-12 10:50
 * @Description:
 */
public class InnerClassSingleton {
    private InnerClassSingleton(){
        System.out.println("outer class init");
    }
    public static InnerClassSingleton getInstance(){
        return InnerHandlerClass.innerClassSingleton;
    }
    private static class InnerHandlerClass{
        public static final InnerClassSingleton innerClassSingleton = new InnerClassSingleton();
        static {
            System.out.println("inner class init");
        }
    }
}
